<%-- 
    Document   : DisplaySubmission
    Created on : 7/05/2008, 18:07:05
    Author     : DidierLeung
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<c:set var="title" value="Download Assignment Submission Form" scope="page"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${title}</title>
    </head>
    <body>
        <h1>${title}</h1>
        <f:view>
            <!-- Show error messages -->
            <!--h:messages showSummary="true" showDetail="false"
                        style="color: red;
                        font-family: 'New Century Schoolbook', serif;
                        font-style: oblique"
                        id="errors"/-->
            <h:form id="markAssignmentForm">
                <table>
                    <tr>
                        <td colspan="3">
                            <b>Subject: </b>
                            <h:outputLabel id="subjectCodeLbl" value="#{DownloadAssignmentBean.filterSubjectCode}" /> - 
                            <h:outputLabel id="subjectNameLbl" value="#{DownloadAssignmentBean.subjectName}" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <b>Assessment:</b> Assignment  
                            <h:outputLabel id="assNoLbl" value="#{DownloadAssignmentBean.filterAssignment}" /> - 
                            <h:outputLabel id="assNameLbl" value="#{DownloadAssignmentBean.assignmentName}" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <h:dataTable id="submissionTable" value="#{MarkAssignmentBean.markingScheme}"
                                         var="schemeObj" border="1">
                                <h:column>
                                    <h:outputLabel id="title" value="#{schemeObj.title}"/>
                                    <h:dataTable id="detailsTable" value="#{schemeObj.detailsList}"
                                                 var="detailsObj">
                                        <h:column>
                                            <h:outputLabel id="detailOutput" value="-#{detailsObj}"/>
                                        </h:column>
                                    </h:dataTable>
                                </h:column>
                                <h:column>
                                    <h:inputText id="studentMark" value="#{schemeObj.mark}" 
                                                    size="2" validator="#{schemeObj.validateInputMark}"/>
                                    <h:outputLabel id="allocatedMark" value="/#{schemeObj.allocatedMark}"/><br/>
                                    <h:message id="errorMsg" for="studentMark" showSummary="true" showDetail="false"
                                     style="color: red; font-family: 'New Century Schoolbook', serif;
                                        font-style: oblique"/>
                                </h:column>
                            </h:dataTable>
                        </td>
                    </tr
                    <tr>
                        <td colspan="3">
                            <b><h:outputLabel id="commentsLbl" value="Comments"/></b><br />
                            <h:inputTextarea id="commentTA" value="#{MarkAssignmentBean.comments}"
                                             rows="5" cols="60"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h:commandButton id="back" value="< Back" action="back"/>
                        </td>
                        <td>
                            <h:commandButton id="submitMark" value="Submit Marking" action="#{MarkAssignmentBean.submitMarking}"/>
                        </td>
                        <td>
                            <h:commandButton id="cancel" value="Cancel" action="cancel"/>
                        </td>
                    </tr>
                </table>
            </h:form>
        </f:view>
    </body>
</html>
